<?php
/**
 * Created by PhpStorm.
 * User: xiatong
 * Date: 2018/9/25
 * Time: 下午9:35
 */

namespace app\store\model;


use \app\common\model\Recharge as RechargeModel;
use think\Request;

class Recharge extends RechargeModel
{

    public function getList(){
        $request = Request::instance();
        return $this->order(['create_time' => 'desc'])
            ->paginate(15, false, ['query' => $request->request()]);
    }

    /**
     * 编辑充值卡
     * @param $data
     * @return bool|int
     */
    public function edit($data)
    {
         return $this->allowField(true)->save($data);

    }

    public function add($data){
        $data['wxapp_id'] = self::$wxapp_id;

        return $this->allowField(true)->save($data);


    }
}